Skip to content

Conversation

@nusbaume
Copy link
Collaborator

@nusbaume nusbaume commented Jan 6, 2026

Tag name (required for release branches):
Originator(s): nusbaume

Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):

This PR allows for the "pretty-printing" of namelist variables in the SIMA log file that are arrays. Originally the variables were printed in an entirely un-formatted way, which could make it difficult to read. Now array variables are printed to the log like so:

aero_phys_props_climate(1) =
 N:sulf:bulk_sulfate:/glade/campaign/cesm/cesmdata/inputdata/atm/cam/physprops/sulfate_camrt_c080918.nc

aero_phys_props_climate(2) =
 N:dust1:dust_bin1:/glade/campaign/cesm/cesmdata/inputdata/atm/cam/physprops/dust1_camrt_c120518.nc                                                                                           
aero_phys_props_climate(3) =
 N:dust2:dust_bin2:/glade/campaign/cesm/cesmdata/inputdata/atm/cam/physprops/dust2_camrt_c120518.nc                                                                                           
aero_phys_props_climate(4) =
 UNSET                                                                                                                                                                                        
aero_phys_props_climate(5) =
 UNSET                      

The PR also removes a non-varying property in the namelist reader generation code, adds the iomsg output to the actual read calls, and now only writes the namelist variable values to the log if the logging level is greater than the minimum.

Fixes #450

Describe any changes made to build system: Modifications were made to the namelist reader generation routine.

Describe any changes made to the namelist: No changes to the namelist files themselves (just the generated readnl routines).

List any changes to the defaults for the input datasets (e.g. boundary datasets): N/A

List all files eliminated and why: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status development...<your_branch_name>)

M cime_config/create_readnl_files.py

  • Add array pretty-printing, iomsg, and log-level control to generated Fortran. Remove un-needed log_info variable.

M src/control/runtime_opts.F90

  • Add comment indicating the need to read the logging namelist first.

M test/unit/python/sample_files/namelist_files/banana_namelist.F90
M test/unit/python/sample_files/namelist_files/kumquat_namelist.F90

  • Update testing files to incorporate new Fortran code.

M test/unit/python/test_create_readnl_files.py

  • Add test to make sure array dimension number limit check works correctly.

If there are new failures (compared to the test/existing-test-failures.txt file),
have them OK'd by the gatekeeper, note them here, and add them to the file.
If there are baseline differences, include the test and the reason for the
diff. What is the nature of the change? Roundoff?

derecho/intel/aux_sima: ALL PASS excluding expected multitape failure.

derecho/gnu/aux_sima: ALL PASS

If this changes climate describe any run(s) done to evaluate the new
climate in enough detail that it(they) could be reproduced:

CAM-SIMA date used for the baseline comparison tests if different than latest:

@nusbaume nusbaume self-assigned this Jan 6, 2026
@nusbaume nusbaume added enhancement New feature or request bug-fix This PR was created to fix a specific bug. labels Jan 6, 2026
Copy link
Member

@jimmielin jimmielin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nusbaume!

Copy link
Collaborator

@peverwhee peverwhee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one tiny optional thing


ofile.comment("Print out namelist values", 3)
ofile.write("if (debug_output >= DEBUGOUT_INFO) then", 3)
msg = f"Namelist values from {grpname} for {self.scheme}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not critical at all, but maybe a slightly clearer message?

Suggested change
msg = f"Namelist values from {grpname} for {self.scheme}"
msg = f"Namelist values from group '{grpname}' for scheme '{self.scheme}'"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super-critical change made. Thanks for the suggestion!

@nusbaume nusbaume merged commit 8ad34dd into ESCOMP:development Jan 8, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix This PR was created to fix a specific bug. enhancement New feature or request

Projects

Status: Tag

Development

Successfully merging this pull request may close these issues.

3 participants